package com.yaorange.response.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 15332
 * @version 1.0
 * @date 2025/6/16 17:03
 * @description 枚举，相应状态码的一个枚举类
 */
@Getter
@AllArgsConstructor
public enum ResultCode {
  SUCCESS(200, "操作成功"),
  FAIL(400, "操作失败"),
  UNAUTHORIZED(401, "未授权或 Token 失效"),
  FORBIDDEN(403, "没有权限访问该资源"),
  NOT_FOUND(404, "请求资源不存在"),
  SERVER_ERROR(500, "服务器内部错误"),
  VALIDATE_FAILED(400, "参数校验失败"),
  LOGIN_SUCCESS(200, "登录成功"),
  LOGOUT_SUCCESS(200, "退出登录成功"),
  RELATION_FAILED(501,"没有选中或角色有关联用户，删除失败"),
  USER_FAILED(502,"用户名或密码错误"),
  FILE_EMPTY(503,"文件不能为空");

  private final int code;
  private final String message;

}
